package com.aqie.advanced.springApplication.context;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;

/**
 * 测试上下文加载顺序 在resources\META-INF\spring.factories 进行配置
 * @param <C>
 */
@Slf4j
@Order(Ordered.HIGHEST_PRECEDENCE)
public class HelloWorldApplicationContextInitializer<C extends ConfigurableApplicationContext> implements ApplicationContextInitializer {
    @Override
    public void initialize(ConfigurableApplicationContext applicationContext) {
        log.info("ConfigurableApplicationContext.id = {}", applicationContext.getId());
    }
}
